home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
rjs.lha
/
RJS
/
String
/
src
/
op_equal.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-06-14
|
864b
|
54 lines
#include "String.h"
// operator =
RJS_String &RJS_String::operator = (char ch)
{
assign(&ch,1);
return *this;
}
RJS_String &RJS_String::operator = (const char *s)
{
assign(s,RJS_String::length(s));
return *this;
}
RJS_String &RJS_String::operator = (const RJS_String &str)
{
if (this==&str) return *this;
assign(str.cptr(),str.length());
return *this;
}
// operator = for substrings
RJS_SubString &RJS_SubString::operator = (char ch)
{
assign(&ch,1);
return *this;
}
RJS_SubString &RJS_SubString::operator = (const char *s)
{
assign(s,RJS_String::length(s));
return *this;
}
RJS_SubString &RJS_SubString::operator = (const RJS_String &s)
{
assign(s.cptr(),s.length());
return *this;
}
RJS_SubString &RJS_SubString::operator = (const RJS_SubString &ss)
{
if (this==&ss) return *this;
assign(ss.cptr(),ss.length());
return *this;
}